package org.bud.boot.result;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author shaun
 * @date 2024/7/19
 * @instruction
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class PageData<T>{
    private T record;

    private Integer total;

    public static <T> PageData<T> of(Integer total,T record){
        return new PageData<T>(record,total);
    }

    public static <T> PageData<T> empty(){
        return PageData.<T>builder().total(0).build();
    }
}
